package com.chixing.day10_hashcode_exception;

public class StudentTest {
    public static void main(String[] args) {
        /*Student stu1 = new Student(101,"小米","个",455L);
        Student stu2 = new Student(101,"小米","个",455L);

        System.out.println(stu1==stu2);//false == 比较内存地址
        System.out.println(stu1.equals(stu2));//false 比较内容
*/
        System.out.println((int)('x'+'d'));//220
        System.out.println((int)('y'+'c'));//220


        //通过哈希函数得到的一个值
        System.out.println("hello".hashCode());//99162322
        System.out.println("hellp".hashCode());//99162323
        System.out.println("helmo".hashCode());//99162353

        Student stu1 = new Student(101,"小米","个",455L);
        Student stu2 = new Student(101,"小米","个",455L);
        Student stu3 = new Student(103,"小米","个",455855L);
        Student stu4 = new Student(117,"华为","十",4788755L);


        System.out.println(stu1.hashCode());//736330652
        System.out.println(stu2.hashCode());//736330652
        System.out.println(stu3.hashCode());//736845634
        System.out.println(stu4.hashCode());//663502857


    }
}
